(dired-pop-to-buffer): Adjust count-lines val for last line.
authorRichard M. Stallman <rms@gnu.org>
Tue, 6 Apr 1993 17:11:57 +0000 (17:11 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 6 Apr 1993 17:11:57 +0000 (17:11 +0000)
lisp/dired.el

index 818261f1894ed2ccc2e24a8b245ab58a0e5b2407..b44f8dd2bfd184017d80591baf2216921398f631 100644 (file)
@@ -1422,7 +1422,10 @@ Optional argument means return a file name relative to `default-directory'."
        (set-buffer buf)
        (goto-char (point-max))
        (skip-chars-backward "\n\r\t ")
-       (setq target-lines (count-lines (point-min) (point))))
+       (setq target-lines (count-lines (point-min) (point)))
+       ;; Don't forget to count the last line.
+       (if (not (bolp))
+           (setq target-lines (1+ target-lines))))
       (if (<= (window-height window) (* 2 window-min-height))
          ;; At this point, every window on the frame is too small to split.
          (setq w2 (display-buffer buf))